<?php

namespace App\Http\Requests\Backend;

use Illuminate\Foundation\Http\FormRequest;

class ResetRequest extends FormRequest
{
    /**
     * Determine if the user is authorized to make this request.
     *
     * @return bool
     */
    public function authorize()
    {
        return true;
    }

    /**
     * Get the validation rules that apply to the request.
     *
     * @return array
     */
    public function rules()
    {
        return [
            'oldpwd' => 'required',
            'pwd' => 'required|confirmed',
            'pwd_confirmation' => 'required'
        ];
    }

    public function messages()
    {
        return [
            'oldpwd.required' => '请输入旧密码！',
            'pwd.required' => '请输入新密码！',
            'pwd.confirmed' => '两次密码不一致！',
            'pwd_confirmation.required' => '请输入确认密码！'
        ];
    }
}
